﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Bussiness.Product>>" %>
<%@ Import Namespace="Bussiness" %>

<div style="padding:10px">
     <div class="title"><span class="title_icon"><img src="../../Content/images/bullet1.gif" alt="" /></span>
    <% var catelogy = (Bussiness.CateloriesProduct) ViewData["Catelogy"]; %>
    <%= catelogy.Name %></div>
      <div class="new_products">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel id="UpdatePanel1" runat="server">
      <contenttemplate>
   
        <% foreach (var product in ((IEnumerable<Bussiness.Product>) ViewData["ListProducs"]))
           { %>
         
          <div class="new_prod_box"> <a href="/Products/ChiTietSanPham/?ID=<%= product.ID%>">Mã:  <%= product.Code%></a>
          <a href="#">Giá:  <%= Bussiness.Service.Utils.FormatDecimal(product.PriceExprort) %></a>
          <div class="new_prod_bg"> 
            <a href="/Products/ChiTietSanPham/?ID=<%= product.ID%>"><img src="<%= product.PathImage%>"  alt="" class="thumb" border="0" width="100" height="100" /></a> 
          </div>
        </div>     
        
        <% } %>
         </contenttemplate>
         </asp:UpdatePanel>
        <div class="pagination"> 
         <% foreach (var paging in ((IEnumerable<int>)ViewData["ListPage"]))
            { %>
            
                <a href='/Products/DanhSachSanPham/?ID_Catelogy=<%=catelogy.ID %>&PageIndex=<%=paging%>' ><span  id='page_<%=paging%>'><%= paging%></span></a>
                
           <%} %>
        <%-- <span class="current">1</span>--%>
       
         </div>
</div>
<script language="javascript">
//    function Paging(obj) {
//        document.getElementById(obj).className = "current";
//    }

    window.onload = function () {
        document.getElementById('page_<%= Request.QueryString["PageIndex"] %>').className = "current";
     };
</script>